package com.link.base.ext.autocfg.service;


import com.link.core.basic.query.QueryParams;
import com.link.core.basic.service.BasicService;
import com.link.base.ext.autocfg.model.AutoCfgItem;

import java.util.List;
import java.util.Map;

public interface AutoCfgItemService extends BasicService<AutoCfgItem> {

    /**
     * <p>获取直接头对象配置行信息</p>
     *
     * @author yrf
     * @param example
     * @return
     * @throws Exception
     */
    public List<AutoCfgItem> getExtConfig(AutoCfgItem example) throws Exception;

    /**
     * <p>获取直接头对象配置行信息，关联头对象的配置信息，并合并</p>
     *
     * @author yrf
     * @param example
     * @param qps
     * @throws Exception
     */
    public List<AutoCfgItem> getExtConfig(AutoCfgItem example, QueryParams qps) throws Exception;

    /**
     * <p>交换两行数据顺序</p>
     *
     * @author yrf
     * @param id1
     * @param id2
     * @param corp1
     * @param corp2
     * @param headId
     * @return
     * @throws Exception
     */
    public Map<String, Object> swapSeq(Long id1,
                                       Long id2,
                                       Long corp1,
                                       Long corp2,
                                       Long headId) throws Exception;

    /**
     * <p>增删改操作</p>
     *
     * @author yrf
     * @param list
     * @throws Exception
     */
    public void upsertAndDel(List<AutoCfgItem> list) throws Exception;

    /**
     * <p>把配置信息，包括其下子元素列表，转换为map类型</p>
     *
     * @author yrf
     * @param record
     * @return
     */
    public Map<String, Object> toCfgMap(AutoCfgItem record);
}
